#include "mains.h"
#include "motor.h"

SDL_Event event;

int main (int args, char *argc[])
{
    bool quit = false;

    Init SYSINIT;

    CreateWindow();
    Entity TestEnt;
    Entity TestEnt2;
    TestEnt.LoadSprite("res/testplayersprite_dleft.png", 1);
    TestEnt.SetRects(75,45,0,0);
    TestEnt.DrawSprite();
    TestEnt2.LoadSprite("res/testplayersprite_dright.png", 2);
    TestEnt2.SetRects(75,45,100,0);
    TestEnt2.HandleInput();
    TestEnt2.ShowMove();
    TestEnt2.DrawSprite();

    SetParseFile("public.yaml");

    GlobalTimer fps;

    while(quit == false) {
        fps.StartTimer();
        while(SDL_PollEvent(&event)) {
            if ((event.type == SDL_KEYDOWN) && (event.key.keysym.sym == SDLK_ESCAPE)) {
                quit = true;
                if (quit == true) {
                    DestRenderer();
                    DestWindow();
                }
            }
        }
    }
    return 0;
}
